// 一级路由
const Layout = () => import('@/views/layout')
// 二级路由
const Home = () => import('@/views/home')
const Question = () => import('@/views/question')
const Video = () => import('@/views/video')
const Profile = () => import('@/views/profile')
// 一级路由
const Login = () => import('@/views/login')
const UserProfile = () => import('@/views/user')
const UserChat = () => import('@/views/user/chat')
const Search = () => import('@/views/search')
const SearchResult = () => import('@/views/search/result')
const Article = () => import('@/views/article')
const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { path: '/', name: 'Home', component: Home },
      { path: '/question', name: 'Question', component: Question },
      { path: '/video', name: 'Video', component: Video },
      { path: '/user', name: 'Profile', component: Profile }
    ]
  },
  { path: '/login', name: 'Login', component: Login },
  { path: '/userProfile', name: 'UserProfile', component: UserProfile },
  { path: '/userChat', name: 'UserChat', component: UserChat },
  { path: '/search', name: 'Search', component: Search },
  { path: '/searchResult', name: 'SearchResult', component: SearchResult },
  { path: '/article/:id', name: 'Article', component: Article }
]
export default routes
